
public class Thoroughbred {
    private Thoroughbred mother;
    private Thoroughbred father;
    private Integer birthyear;

    public Thoroughbred(Thoroughbred mother, Thoroughbred father, Integer birthyear) {
        this.mother = mother;
        this.father = father;
        this.birthyear = birthyear;
    }

    public Integer getCurrentAge() {
        if (birthyear == null) {
            return null; // 未设置出生年份时返回null
        }
        int currentYear = java.time.LocalDate.now().getYear();
        return currentYear - birthyear;
    }

    public Thoroughbred getFather() {
        return father;
    }

    public Thoroughbred getMother() {
        return mother;
    }

    public void setMother(Thoroughbred mother) {
        this.mother = mother;
    }

    public void setFather(Thoroughbred father) {
        this.father = father;
    }

    public void setBirthyear(Integer birthyear) {
        this.birthyear = birthyear;
    }
}
